<?php
require 'Controller.php ';
require 'admin/model/CommentModel.php';
class CommentController extends Controller{
	function __Construct(){
		parent::__Construct();
		$this->mod = 'comments';
		$this->model = new CommentModel();
	}
function listcomments(){
$data = $this->model->getList();
$this->assign('comments',$data);
$this->display();
	}
		function delcomment(){
		$id = $_GET['id'];
		$model = new CommentModel();
		$result =$model->delcomment($id);

		if($result){
			echo '删除成功 <a href="./admin.php?c=comment&m=listcomments">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='./admin.php?c=comment&m=listcomments'");
		}
		else{
			echo "删除失败！<br/>";
  			echo "<a href='./admin.php?c=comment&m=listcomments'>返回</a>";
		}
	}
}
?>